package cloud.zhixinglu.www.spring.boot.mapstruct.controller;

import cloud.zhixinglu.www.spring.boot.mapstruct.enums.GenderEnum;
import cloud.zhixinglu.www.spring.boot.mapstruct.mapper.StudentMapper;
import cloud.zhixinglu.www.spring.boot.mapstruct.pojo.dto.StudentDTO;
import cloud.zhixinglu.www.spring.boot.mapstruct.pojo.vo.StudentVO;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * TestController
 * </p>
 *
 * @author weixin
 * @date 2023/3/31 11:17
 */
@RestController
public class TestController {

    public static void main(String[] args) {
        StudentDTO studentDTO = StudentDTO.builder()
                .name("小明")
                .age(6)
                .gender(GenderEnum.MALE)
                .height(121.1)
                .birthday(new Date())
                .build();
        List<StudentDTO> list = new ArrayList<>();
        list.add(studentDTO);

        List<StudentVO> studentVOList = StudentMapper.INSTANCE.studentList2StudentVOList(list);
        System.out.println(studentVOList);
    }

}
